package com.demo.web.modules.sys;

import com.demo.common.constant.api.SysBasicVOAPIConstant;
import com.demo.common.result.ResponseInfo;
import com.demo.common.result.ResultVo;
import com.demo.dao.sys.entity.SysPermissionInfo;
import com.demo.service.sys.SysBasicVOService;
import com.demo.service.sys.SysPermissionInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/sys/permission_info")
public class SysPermissionInfoController {
    @Autowired
    private SysPermissionInfoService myService;

    @GetMapping("/test")
    public String test(){
        return "hello, you are in PermissionInfo test!";
    }

    //读取
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public ResultVo getPermissionInfo(@RequestBody Map<String, String> map){
        return ResponseInfo.<Object>success(myService.getPermissionInfoByParams(map));
    }

    //保存
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public ResultVo savePermissionInfo(@RequestBody SysPermissionInfo info){
        return ResponseInfo.<Object>success(myService.savePermissionInfo(info));
    }
}
